# 运算符重载
class Vector:
    def __init__(self,x,y):
        self.x = x
        self.y = y

    # 加法运算符的重载
    def __add__(self,other):
        return Vector(self.x + other.x,self.y + other.y)

    # ==运算符的重载
    def __eq__(self,other):
        return self.x == other.x and self.y == other.y

    # str运算符的重载
    def __str__(self):
        return "x:%s,y:%s" % (self.x,self.y)

v1 = Vector(1,2)
v2 = Vector(2,4)
v3 = v1 + v2
print(v3)
print(v1 == v2)